<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>18</title>
<script src="vue.js"></script>
</head>
<style>

</style>

<body>
  <div class="app">
    ￥：<input type="text" v-model.Number="rmb">
    <br>
    $：<input type="text" v-model="meiyuan">
    <br>
    100人民币 = 14.71美元
  </div>
  <script>
    const moduleA = new Vue({
      el: ".app",
      data() {
        return {
          meiyuan: "",
          rmb: ""
        }
      },
      watch: {
        rmb(newV, oldV) {
          this.meiyuan = (newV / 6.7981).toFixed(4)
        },
        meiyuan(newV, oldV) {
          this.rmb = (newV * 6.7981).toFixed(4)
        }
      }
    })
  </script>
</body>

</html>